@extends('backstage.layout.master')
@section('title', '申请提现详情')
@section('style')
        <!-- page specific plugin styles -->
<link rel="stylesheet" href="backstage/assets/css/jquery-ui-1.10.3.custom.min.css"/>
<link rel="stylesheet" href="backstage/assets/css/chosen.css"/>
<link rel="stylesheet" href="backstage/assets/css/datepicker.css"/>
<link rel="stylesheet" href="backstage/assets/css/bootstrap-timepicker.css"/>
<link rel="stylesheet" href="backstage/assets/css/daterangepicker.css"/>
<link rel="stylesheet" href="backstage/assets/css/colorpicker.css"/>

<!-- fonts -->
<style>
    .ace-file-input input[type=file]{
        position:static;
    }
    .ace-nav {
        height: 10px;
    }
    #container_id{
        align-content: center;
    }
    .detail-create td{
        background-color: #f5f5f5;
    }
</style>
@stop
@section('script')
    <script>

        $(function(){
            $("#order_id_input").bind("keypress",function(event){
                    if(event.keyCode=="13"){
                        findByOrderId();
                    }
            });
        });
        function send(th){
            swal("处理中，请勿重复点击按钮",'','warning');
            $.ajax({
                url:"/backstage/income/transfer-accounts",
                type:"post",
                data:{"withdraw_id":th},
                datatype:'json',
                success:function(re){
                    if(re.state=="M00000"){
                        swal("转账申请成功，等待银联处理结果",'','success');
                        location.reload();
                    }else{
                        swal(re.message,'','warning');
                        return;
                    }
                },
                error:function(){
                    swal('系统繁忙','请稍后重试','warning');
                    return;
                }
            });
        }

        function cancel(th){
            swal("处理中，请勿重复点击按钮",'','warning');
            $.ajax({
                url:"/backstage/income/cancel",
                type:"post",
                data:{"withdraw_id":th},
                datatype:'json',
                success:function(re){
                    if(re.state=="M00000"){
                        swal("取消成功",'','success');
                        location.reload();
                    }else{
                        swal(re.message,'','warning');
                        return;
                    }
                },
                error:function(){
                    swal('系统繁忙','请稍后重试','warning');
                    return;
                }
            });
        }
    </script>

@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>
        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home" target="_blank">主页</a>
            </li>
            <li class="active">
                <a href="/backstage/user/user-apply-withdraw">申请提现列表</a>
            </li>
        </ul><!-- .breadcrumb -->
    </div>
    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        用户
                        <small>
                            <i class="icon-double-angle-right"></i>
                            申请提现详情
                        </small>
                    </h1>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="table-responsive">
                         @if(empty($result))
                         申请提现详情不存在或已删除
                         @else
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                            <tr>
                                                <td style="width:138px;">提现申请编号</td>
                                                <td colspan="3">
                                                    {{isset($result->withdraw_number)?$result->withdraw_number:''}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">用户编号</td>
                                                <td colspan="5">
                                                    {{isset($result->user_id)?$result->user_id:''}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="4">
                                                    申请详情
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">银行名称</td>
                                                <td colspan="5">
                                                    {{isset($result->bank_name)?$result->bank_name:''}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">开户行</td>
                                                <td colspan="3">
                                                    {{isset($result->bank_branch)?$result->bank_branch:''}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">银行卡号</td>
                                                <td colspan="3">
                                                    {{isset($result->bank_card_no)?$result->bank_card_no:''}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">手机</td>
                                                <td colspan="3">
                                                    {{isset($result->phone)?$result->phone:''}}
                                                </td>
                                            </tr>

                                            <tr>
                                                <td style="width:138px;">持卡人姓名</td>
                                                <td colspan="3">
                                                    {{isset($result->card_holder)?$result->card_holder:''}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">金额</td>
                                                <td colspan="3">
                                                    {{isset($result->total_fee)?$result->total_fee:''}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">手续费</td>
                                                <td colspan="3">
                                                    {{isset($result->poundage)?$result->poundage:''}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="6">
                                                    处理结果
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">是否提现完成</td>
                                                <td colspan="3">
                                                    @if(isset($result)&&isset($result->is_over_withdraw)&&
                                                    $result->is_over_withdraw==0&&$result->result==0)
                                                    未完成   &nbsp&nbsp<button onclick="send('{{isset($result->withdraw_id)?$result->withdraw_id:''}}')">点击转账</button>
                                                    &nbsp&nbsp <button onclick="cancel('{{isset($result->withdraw_id)?$result->withdraw_id:''}}')">取消(提现失败)</button>
                                                    @elseif(isset($result)&&isset($result->is_over_withdraw)&&$result->is_over_withdraw==1)
                                                    等待回调
                                                    @elseif(isset($result)&&isset($result->is_over_withdraw)&&$result->is_over_withdraw==2)
                                                    已完成
                                                    @endif
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">提现结果</td>
                                                <td colspan="3">
                                                    @if(isset($result)&&isset($result->result)&&$result->result==0)
                                                        处理中
                                                    @elseif(isset($result)&&isset($result->result)&&$result->result==1)
                                                        成功
                                                    @elseif(isset($result)&&isset($result->result)&&$result->result==2)
                                                        失败
                                                    @endif
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">处理进度</td>
                                                <td colspan="3">
                                                    @if(isset($result)&&isset($result->state)&&$result->state==1)
                                                        处理中
                                                    @elseif(isset($result)&&isset($result->state)&&$result->state==2)
                                                        处理完成
                                                    @endif
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width:138px;">结果描述</td>
                                                <td colspan="3">
                                                    {{isset($result->result_message) ? $result->result_message : ''}}
                                                </td>
                                            </tr>
                                    </table>
                                @endif
                                </div>

                                <!-- <div class="clearfix form-actions" >
                                    @if(isset($result->order->order_id))
                                    <div class="col-md-offset-3 col-md-9">
                                        <button id="saveButton" class="btn btn-info" type="button" onclick="refund();">
                                           <i class="icon-ok bigger-110"></i>
                                           修改
                                        </button>
                                    </div>
                                    @endif
                                </div> -->
                        </div>

                     </div>
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
